home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / PredatorPrey / myClikLoop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-22  |  1.1 KB  |  39 lines  |  [TEXT/KAHL]

  1. /************************************************************************************/
  2. /*    myClikLoop                                                                        */
  3. /*                                                                                    */
  4. /*    Note:    executed repeatedly when the mouse is held down, and dragged outside of    */
  5. /*            the viewRect                                                            */
  6. /************************************************************************************/
  7. #include "myClickLoop.h"
  8. #include "Globals.h"
  9. #ifndef __C14__
  10. #include    "PredatorPrey.h"
  11. #endif
  12. #include "myActionProc.h"
  13.  
  14. void    myClickLoopSeg()    {}
  15.  
  16. pascal Boolean myClikLoop()
  17. {
  18.     int            myClikRetCode;
  19.     Point        myMouseLoc;
  20.     int            vScrollAmt;
  21.  
  22.     myClikRetCode = TRUE;
  23.  
  24.     GetMouse (&myMouseLoc);
  25.     
  26.     GetClip(workRegionH);                                            /* sve clip rgn    */
  27.     ClipRect(&(*windTbl[windSub].windPtr).portRect);                /* reset it        */
  28.  
  29.     if (myMouseLoc.v > (**windTbl[windSub].windTEH[0]).viewRect.bottom)    /* down    */
  30.         myActionProc (windTbl[windSub].windCntlH[0], inDownButton);
  31.     else
  32.     if (myMouseLoc.v < (**windTbl[windSub].windTEH[0]).viewRect.top)    /* up    */
  33.         myActionProc (windTbl[windSub].windCntlH[0], inUpButton);
  34.  
  35.     SetClip(workRegionH);                                            /* restore clip    */
  36.  
  37.     return myClikRetCode;
  38. }
  39.